package com.hnzq.cloud.api;

import com.hnzq.cloud.IO.AddDriverworkIO;
import com.hnzq.cloud.IO.DriverToAreaParam;
import com.hnzq.cloud.IO.SelectDriversIO;
import com.hnzq.cloud.IO.entity.FreDriverwork;
import com.hnzq.cloud.model.Result;
import com.hnzq.cloud.util.FreException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "send-assembly",contextId = "freDriver",path = "freDriver")
public interface FreDriverworkApi {
    @GetMapping("getByUserId")
    Result<FreDriverwork> getByUserId(@RequestParam("id")Integer id) throws FreException;
    @GetMapping("getById")
    Result<FreDriverwork> getById(@RequestParam("id")Integer id) throws FreException;
    @GetMapping("getByArea")
    Result<FreDriverwork> getByArea(@RequestParam("id")Integer id) throws FreException;
    @GetMapping("getDrivers")
    Result<List<FreDriverwork>> getDrivers(SelectDriversIO selectDriversIO);

    @PostMapping("add")
    Result addDriverwork(@RequestBody AddDriverworkIO addDriverworkIO) throws FreException;
    @PutMapping("driverToArea")
    Result driverToArea(@RequestBody DriverToAreaParam driverToAreaParam) throws FreException;

    @PutMapping("editWareHouse")
    Result editDriverwork(@RequestBody AddDriverworkIO addDriverworkIO);

    @PutMapping("editStatus")
    Result editDriverworkStatus(@RequestBody AddDriverworkIO addDriverworkIO);

    @DeleteMapping("deleteSend")
    Result deleteDriverwork(@RequestParam("id") Integer id) throws FreException;
}
